package com.hsylient.mybatis.service;

import com.hsylient.common.entity.Student;
import com.hsylient.mybatis.mapper.StudentMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
public class StudentService {

    @Resource
    private StudentMapper studentMapper;


    @Transactional(rollbackFor = Exception.class)
    public void modify(Student student) {
        studentMapper.updateById(student);
    }

    public Student findById(Long id) {
        return studentMapper.selectById(id);
    }
}
